import { defineStore } from 'pinia'
import { ref } from 'vue'

export interface IUser {
  [key: string]: string | string[]
}
const useUser = defineStore(
  'user',
  () => {
    const userInfo = ref<IUser>({})
    const setUserInfo = (info: IUser) => {
      console.log(info, '给store设置值')
      userInfo.value = info
    }
    return { userInfo, setUserInfo }
  },
  {
    persist: true
  }
)
export default useUser
